create table Utility
(
	 [UtilityId] int identity(1, 1) primary key
	,[UtilityName] nvarchar(128)
	,[UtilityType] int
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE UtilityGet
	@UtilityId int	
AS
SELECT *
FROM [Utility]
WHERE [Utility].[UtilityId] = @UtilityId
GO

CREATE PROCEDURE UtilityList
AS
SELECT *
FROM [Utility]
GO

CREATE PROCEDURE UtilityInsert
	 @UtilityName nvarchar(128)
	,@UtilityType int
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO Utility (
	 [UtilityName]
	,[UtilityType]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @UtilityName
	,@UtilityType
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE UtilityUpdate
	@UtilityId int, 
	@UtilityName nvarchar(128), 
	@UtilityType int, 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 
AS
UPDATE Utility SET
	    [UtilityName] = @UtilityName
	   ,[UtilityType] = @UtilityType
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [Utility].[UtilityId] = @UtilityId
GO

CREATE PROCEDURE UtilityDelete
	@UtilityId int    
AS
DELETE FROM Utility
WHERE [Utility].[UtilityId] = @UtilityId
GO